Converts the specified tick amount to hours, minutes, and seconds.
#Include <Date.au3>
_TicksToTime ( $iTicks, $iHours, $iMins, $iSecs )
Parameters
$iTicks | Tick amount. |
$iHours | Variable to store the hours. |
$iMins | Variable to store the minutes. |
$iSecs | Variable to store the seconds. |
Return Value
Success: | Returns 1. |
Failure: | Returns 0. |
@Error: | 0 = No error. |
1 = $iTicks isn't an integer. |
Remarks
None.
Related
_TimeToTicks
Example
; *** Demo to show a timer window
#include <GUIConstants.au3>
#include <Date.au3>
opt("TrayIconDebug",1)
Global $Secs, $Mins, $Hour, $Time
;Create GUI
GUICreate("Timer",120, 50)
GUICtrlCreateLabel("00:00:00", 10,10)
GUISetState()
;Start timer
$timer = TimerInit()
AdlibEnable("Timer", 50)
;
While 1
;FileWriteLine("debug.log",@min & ":" & @sec & " ==> before")
$msg = GUIGetMsg()
;FileWriteLine("debug.log",@min & ":" & @sec & " ==> after")
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
Wend
;
Func Timer()
_TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs )
Local $sTime = $Time ; save current time to be able to test and avoid flicker..
$Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
If $sTime <> $Time Then ControlSetText("Timer", "", "Static1", $Time)
EndFunc ;==>Timer